const { getSettingDao, updateSettingDao } = require("../dao/settingDao")
const { formatResponseBody } = require("../utils/tools");

// 获取全局设置
exports.getSettingService = async () => {
    const [result] = await getSettingDao();
    return formatResponseBody({data: result.dataValues});
}

// 修改全局设置
exports.updateSettingService = async (newSetting) => {
    await updateSettingDao(newSetting);
    return this.getSettingService();
}